import request from '@/utils/request'
import store from '@/store'

export function addAddress (params) {
  return request({
    url: '/addr',
    method: 'post',
    data: Object.assign(params, { 'createUserId': store.getters.userInfo.id })
  })
}

export function queryAddress (params) {
  return request({
    url: '/addr',
    method: 'get',
    params: { 'createUserId': store.getters.userInfo.id }
  })
}

export function deleteAddress (params) {
  return request({
    url: '/addr',
    method: 'delete',
    data: params
  })
}

export function updateAddress (params) {
  return request({
    url: '/addr',
    method: 'put',
    data: Object.assign(params, { 'createUserId': store.getters.userInfo.id })
  })
}
